

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4A90E2;
    --secondary-color: #50C878;
    --danger-color: #E74C3C;
    --warning-color: #F39C12;
    --bg-color: #F5F7FA;
    --card-bg: #FFFFFF;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #E0E0E0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}



header {
    background: var(--card-bg);
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

header h1 {
    font-size: 28px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

nav {
    display: flex;
    gap: 15px;
}

nav a {
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
    font-weight: 500;
}

nav a:hover {
    background: var(--bg-color);
}

nav a.active {
    background: var(--primary-color);
    color: white;
}



main {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    min-height: 500px;
}



.control-panel {
    margin-bottom: 30px;
}

.settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-group label {
    font-weight: 600;
    color: var(--text-color);
}

.setting-group select {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.setting-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}



.recording-controls {
    text-align: center;
}

.record-btn {
    padding: 20px 40px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--primary-color), #357ABD);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.record-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.record-btn:active {
    transform: translateY(0);
}

.record-btn.recording {
    background: linear-gradient(135deg, var(--danger-color), #C0392B);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.record-icon {
    font-size: 24px;
}

.recording-status {
    margin-top: 15px;
    font-size: 14px;
    color: var(--text-light);
    min-height: 20px;
}


.upload-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #3498DB, #2980B9);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    margin-left: 15px;
}

.upload-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.upload-btn:active {
    transform: translateY(0);
}

.upload-icon {
    font-size: 24px;
}

.upload-status {
    margin-top: 15px;
    font-size: 14px;
    color: var(--text-light);
    min-height: 20px;
    font-weight: 600;
}



.results {
    margin-top: 30px;
}

.result-section {
    margin-bottom: 25px;
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: #FAFBFC;
}

.result-section h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 18px;
}

.result-content {
    padding: 15px;
    background: white;
    border-radius: 8px;
    line-height: 1.8;
    min-height: 60px;
}

.placeholder {
    color: var(--text-light);
    font-style: italic;
}

.add-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.add-btn:hover {
    background: #45B369;
    transform: translateY(-2px);
}



.stats {
    background: linear-gradient(135deg, #667EEA, #764BA2);
    border: none;
    color: white;
}

.stats h3 {
    color: white;
}

.stats-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.stat-label {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
    opacity: 0.9;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
}



.loading {
    text-align: center;
    padding: 50px 0;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), #357ABD);
    color: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-number {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 16px;
    opacity: 0.9;
}



.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    gap: 20px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.toolbar-actions {
    display: flex;
    gap: 10px;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #357ABD;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}



.vocabulary-list {
    display: grid;
    gap: 15px;
}

.vocab-item {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
}

.vocab-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.vocab-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vocab-french {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

.vocab-chinese {
    font-size: 16px;
    color: var(--text-color);
}

.vocab-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 5px;
}

.vocab-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vocab-actions button {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.edit-btn {
    background: var(--primary-color);
    color: white;
}

.edit-btn:hover {
    background: #357ABD;
}

.delete-btn {
    background: var(--danger-color);
    color: white;
}

.delete-btn:hover {
    background: #C0392B;
}



.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--primary-color);
}

.close {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
}



footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 14px;
}



@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        padding: 15px 20px;
    }

    header h1 {
        font-size: 22px;
    }

    main {
        padding: 20px;
    }

    .settings {
        grid-template-columns: 1fr;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .vocab-item {
        grid-template-columns: 1fr;
    }

    .vocab-actions {
        justify-content: flex-end;
    }
}



.text-center {
    text-align: center;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.hidden {
    display: none !important;
}

